#{extends 'main.html' /} 
#{set title:'Forum' /}

<script type="text/javascript">
	function voltar(){
		window.open("@{Application.principal}","_top");
	}
</script>

#{cabecalho/}

#{erros/}

<body>

	<form action="@{Foruns.cadastrarForum()}" method="GET">
		<table align="center">
			<tr>
				<td colspan="2">
					Cadastrar Novo Forum
				</td>
			</tr>
			<tr>
				<td>
					Tema do Forum: &nbsp;
				</td>
				<td>
					<input type="text" name="tema" class="login-box-field" />
				</td>
			</tr>
			<tr>
				<td>
					<input type="hidden" name="idUsuario" value="${session.usuario}" class="login-box-field" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<input type="submit" value="Cadastrar"/>
					<input type="button" value="Voltar" onclick="voltar()"/>
				</td>
			</tr>
		
		</table>
	</form>
	
	</br>
	
	#{list items: listaForuns, as:'forum'}
		<table>
			<tr>
				<td>
					(Data)
				</td>
				<td>
					Criado por: ${forum.usuario.nome}
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<a href="@{Foruns.topicos(forum.id_forum)}" >  Tema: ${forum.tema} </a>
				</td>
			</tr>
		</table>
	#{/list}

	
	<!-- <table action="" method="GET">
		<tr>
			<td>
				Responder Topico
			</td>
		</tr>
		<tr>
			<td>
				<textarea rows="10" cols="100"></textarea>
			</td>
		</tr>
		
		<tr align="center">
			<tr>
				<td colspan="2">
					<input type="submit" value="Postar"/>
					<input type="button" value="Voltar" onclick="voltar()"/>
				</td>
			</tr>
		</tfoot>
	
	</table> -->
</body>

#{rodape/}